<?php
use yii\bootstrap\Nav;
use yii\helpers\Html;
use yii\helpers\Url;

?>

<!--top header-->
<div class="header">
    <div class="container">
        <ul class="navbar-link list-inline pull-right">
            <?php if(Yii::$app->user->isGuest) { ?>
            <li><a href="<?= Url::toRoute('/user/security/login')?>">登录</a></li>
            <li class="spacer"></li>
            <li><a href="<?= Url::toRoute('/user/registration/register')?>">注册</a></li>
            <?php } else { ?>
            <li>
                <?=Yii::$app->user->identity->getDisplayName()?>
                <?= Html::a('退出', ['/user/security/logout'], ['data' => ['method' => 'post']]) ?>
            </li>
            <?php }?>
            <li class="spacer"></li>
            <li><a href="<?= Url::to('/user/profile/index')?>">会员中心</a></li>
            <li class="spacer"></li>
            <li><a href="<?= Url::toRoute('/wine/login')?>">酒店登录</a></li>
            <li class="spacer"></li>
            <li>场地咨询：4001-666-888</li>
        </ul>
        <div class="hidden-xs pull-left">嘿！Dear，来找场地开会吗？</div>
    </div>
</div>
<!--end top header-->

<!--search-->
<div class="container search">
    <a href="http://www.jojomeet.com" class="logo">桌桌网</a>
    <div class="search-warp">
        <form class="search-form">
            <input class="search-input">
            <button class="btn btn-theme">搜 索</button>
            <a href="#" class="btn btn-gray">发布需求</a>
        </form>
        <div class="hot-words">
            <a href="#">培训场地</a>
            <a href="#">拓展团建</a>
            <a href="#">特价场地</a>
            <a href="#">中关村</a>
            <a href="#">望京</a>
            <a href="#">国家会议中心</a>
        </div>
    </div>
</div>
<!--end search-->

<!--nav-->
<div class="navigation clearfix">
    <div class="container">
        <?php if(in_array(Yii::$app->request->url, ['/site/index', '/'])) {?>
        <div class="pull-left service-text">桌桌特色服务</div>
        <?php }?>
        <?= Nav::widget([
            'id' => 'navigation',
            'options' => ['class' => 'nav navbar-nav'],
            'items' => [
                in_array(Yii::$app->request->url, ['/site/index', '/'])?'':['label' => '首页', 'url' => [Yii::$app->homeUrl]],
                ['label' => '找场地', 'url' => ['/venue/index']],
                ['label' => '挑主题', 'url' => ['/theme/index']],
                ['label' => '订特价', 'url' => ['/special/index']],
                ['label' => '发需求', 'url' => ['/demand/index']],
                ['label' => '学攻略', 'url' => ['/strategy/index']],
                ['label' => '会务服务商', 'url' => ['/facilitator/index']],
                ['label' => '大客户专区', 'url' => ['/site/contact']],
            ]
        ]);
        ?>
    </div>
</div>
<!--end nav-->